// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{7fa0be54-b049-427d-be9a-8d03090afc3c}")]
	#endregion

	#region Documentation
	//1 Pokalwettbewerb
	/// Pokalwettbewerb
	#endregion

	#endregion
	public class Pokalwettbewerb: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 3);
			public const int Pokalbegegnung_MemberIndex = Eco_FirstMember + 0;
			public const int Pokalklasse_MemberIndex = Eco_FirstMember + 1;
			public const int Spieldimension_MemberIndex = Eco_FirstMember + 2;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalwettbewerb.Eco_LoopbackIndices.Pokalbegegnung_MemberIndex), Id="{a9bec61c-29fd-4b2c-83b9-8f6b3201059e}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalwettbewerbPokalbegegnung), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Pokalbegegnung> Pokalbegegnung
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Pokalbegegnung>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalbegegnung_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalwettbewerb.Eco_LoopbackIndices.Pokalklasse_MemberIndex), Id="{2173eec9-a4e5-4b8b-b8e3-e0c03b70b81d}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalbegegnungPokalwettbewerb), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Pokalklasse Pokalklasse
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Pokalklasse) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalklasse_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Pokalklasse_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalwettbewerb.Eco_LoopbackIndices.Spieldimension_MemberIndex), Id="{8e064004-a1c4-456d-8956-ff7d3c306eed}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalwettbewerbSpieldimension), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Spieldimension Spieldimension
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Spieldimension) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spieldimension_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spieldimension_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Pokalwettbewerb(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Pokalwettbewerb(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
